
<html>
  <head>
    <title>denglu.html</title>
	
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet"  href="css/jquery.mobile-1.3.2.css">
<!-- <link rel="stylesheet"  type="text/css" href="css/jquery.autocomplete.css"> -->
<script type="text/javascript"  language="javascript" src="js/jquery-1.11.1.js"></script>
<script type="text/javascript"  language="javascript" src="js/jquery.mobile-1.3.2.js"></script>
<!-- 下边两个链接基本上不用管，用的上就用，用不上就删 -->
<!--<script type="text/javascript"  language="javascript" src="js/sisyphus.js"></script> -->
<script type="text/javascript"  language="javascript" src="js/jquery.autocomplete.js"></script>


</head>
 <body>
 <div data-role="page" id="pageone" data-position="inline">
  <div data-role="header">
    <h1>登录页面</h1>
  </div>
 
 <div data-role="content" id = "search">
    <div data-role="fieldcontain">
            <label for="fullname">用户姓名:&nbsp;</label>
    <input type="text" name="name"  id="idn" placeholder="用户名"><br>       
            <label for="fullname">密码:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
    <input type="password" name="password" id="idp" placeholder="密码">
   <!--  这些乱七八糟的就是滑块了 直接提交到上边的as() 方法设置滑块 on off id=switch 接收之后再设置 on off-->
        <label for="switch">记住账户：</label>
        <select name="switch" id="switch" data-role="slider" onclick="as()">
          <option value="on">是</option>
          <option value="off">否</option>
        <select>
      </div>
      <input type="submit" data-inline="true"  onClick="ajaxRequest()" value="登陆">
      <a href="#pageone"><input type="button"  value="取消" data-inline="true"></a>
 
    
    <!--<button type="button" data-transition="slide" data-direction="reverse" data-role="button" value="登录" onclick="ab()">测试</button>-->
      

      </div>    
<script  type="text/javascript" language="javascript">
var storage = window.localStorage;
 function as(name){
// storage记录
//比如说这里接收switch
 if($("#switch").val()=="on"){
 storage.name=name;
 
	 }
}

$(document).ready(function(){ 
//idn记录用户名
$("#idn").val(storage.name);
 });
function ajaxRequest(){
//idn记录用户名
 var result1=$("#idn").val();
 //idp密码
 var result2=$("#idp").val();
 //用户名密码判断
 as(result1,result2);

 var a="http://www.dengluyi.com:8080/Spring3HibernateMaven/admin/lists.mobile"
//提交到服务器上边是地址，下边是提交，用的是 post 提交的呵呵
$.post(a,
{"name":result1,"password":result2},function(data){
if(data=="true"){
alert("错误");
}else{
//下边这个地方是用来跳转的 transition可以用来调节跳转的N种方式，有很多惊喜哟！
$.mobile.changePage("index.html",
{ transition:"slide"});
cardno="result1";
}
});
}
//这个用来测试吧,用不上也可以删
function ab(){
 if(storage.name==null){
  alert("空");
     }else{
     alert(storage.name);
     }
}
</script>
           

  
</div>

  </body>
</html>


